import requests

sss="""
以下一个地球化学领域机器学习的部分 doc 文档手册的内容：\n
WT%)
--------------------
Feature Engineering Option:
1 - Yes
2 - No
(Data) ➜ @Number: 2
> Enter
Successfully store 'Data Selected Dropped-Imputed
Feature-Engineering' in 'Data Selected Dropped-Imputed
Feature-Engineering.xlsx' in /Users/lcthw/geopi/geopi_output/GeoPi
- Rock Classification/XGBoost Algorithm - Test 1/artifacts/data.
(Press Enter key to move forward.)
> Enter
```
## 3. Data Processing
We select **2 - Classification** as our model:
```bash
-*-*- Mode Selection -*-*-
1 - Regression
2 - Classification
3 - Clustering
4 - Dimensional Reduction
(Model) ➜ @Number: 2
> Enter
(Press Enter key to move forward.)
> Enter
```
Before we start the classfication model training, we have to specify our X and Y data set. in the example of our selected data set, we take column [2,7] as our X set and column 1 as Y.
```bash
-*-*- Data Segmentation - X Set and Y Set -*-*-
Divide the processing data set into X (feature value) and Y
(target value) respectively.
Selected sub data set to create X data set:
--------------------
Index - Column Name
1 - Label
2 - SIO2(WT%)
3 - TIO2(WT%)
4 - AL2O3(WT%)
5 - CR2O3(WT%)
6 - FEOT(WT%)
7 - CAO(WT%)
--------------------
The selected X data set:
Select the data range you want to process.
Input format:
Format 1: "[**, **]; **; [**, **]", such as "[1, 3]; 7; [10, 13]" --> you want to deal with the columns 1, 2, 3, 7, 10, 11, 12, 13
Format 2: "xx", such as "7" --> you want to deal with the columns 7
@input: [2, 7]
```
```bash
--------------------
Index - Column Name
2 - SIO2(WT%)
3 - TIO2(WT%)
4 - AL2O3(WT%)
5 - CR2O3(WT%)
6 - FEOT(WT%)
7 - CAO(WT%)
--------------------
Successfully create X data set.
The Selected Data Set:
   SIO2(WT%) TIO2(WT%) ... FEOT(WT%)  CAO(WT%)
0   53.640000  0.400000 ... 11.130000 20.240000
1   52.740000  0.386000 ... 
'\n现在，根据以上内容生成一个 qa 对，第一段是提问，第二段是回答。如下：\n
"""

# 服务的URL
url = "http://36.140.172.136:60066/generate"

# 要发送的输入文本
data = {
    "input_text": sss
}

# 发送POST请求
response = requests.post(url, json=data)

# 检查请求是否成功
if response.status_code == 200:
    # 打印生成的文本
    generated_text = response.json().get("generated_text", "")
    print("生成的文本:", generated_text)
else:
    print("请求失败，状态码:", response.status_code)
